package com.jpz.bean;

import java.util.ArrayList;
import java.util.List;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

@TableName(value="sys_user")
public class User {
	@TableId(value="id" , type =IdType.AUTO)
	private Integer id;
	private String username;
	private String password;
	private String salt;
	private String locked;
	private String lastlogintime;
	private Integer del;
	private String photo;
	private String ip;
	private String usercode;
	
	public String getUsercode() {
		return usercode;
	}

	public void setUsercode(String usercode) {
		this.usercode = usercode;
	}

	@TableField(exist=false)
	private List<Role> roles=new ArrayList<Role>();
	
	public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

	public User() {
		super();
	}
	
	public User(Integer id, String username, String password, String salt, String locked, String lastlogintime,
			Integer del, String photo) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
		this.salt = salt;
		this.locked = locked;
		this.lastlogintime = lastlogintime;
		this.del = del;
		this.photo = photo;
	}

	public String getLastlogintime() {
		return lastlogintime;
	}

	public void setLastlogintime(String lastlogintime) {
		this.lastlogintime = lastlogintime;
	}

	public User(Integer id, String username, String password, String salt, String locked, String lastlogintime,
			Integer del) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
		this.salt = salt;
		this.locked = locked;
		this.lastlogintime = lastlogintime;
		this.del = del;
	}

	public User(String username, String password) {
		super();
		this.username = username;
		this.password = password;
	}

	public User(Integer id, String username, String password, String salt, String locked, Integer del) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
		this.salt = salt;
		this.locked = locked;
		this.del = del;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getSalt() {
		return salt;
	}
	public void setSalt(String salt) {
		this.salt = salt;
	}
	public String getLocked() {
		return locked;
	}
	public void setLocked(String locked) {
		this.locked = locked;
	}
	public Integer getDel() {
		return del;
	}
	public void setDel(Integer del) {
		this.del = del;
	}
	
	public String getPhoto() {
		return photo;
	}
	
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + ", salt=" + salt + ", locked="
				+ locked + ", del=" + del + "]";
	}
	
	


}
